package com.mycompony.shopping.shangguan.sys.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.mycompony.shopping.shangguan.sys.dao.AuthRoleMapper;
import com.mycompony.shopping.shangguan.sys.model.Auth;
import com.mycompony.shopping.shangguan.sys.model.Role;
import com.mycompony.shopping.shangguan.sys.service.AuthRoleService;

public class AuthRoleServiceImpl implements AuthRoleService {

	private AuthRoleMapper authRoleMapper;

	public AuthRoleMapper getAuthRoleMapper() {
		return authRoleMapper;
	}

	public void setAuthRoleMapper(AuthRoleMapper authRoleMapper) {
		this.authRoleMapper = authRoleMapper;
	}

	public List<Auth> getAuthListByRole(Role role) {

		if (role == null || StringUtils.isEmpty(role.getRoleid())) {
			return null;
		}

		return authRoleMapper.getAuthListByRole(role);
	}

}
